<extend name="admin/main"/>

<block name="title">
    <title>添加新闻</title>
</block>

<block name="css">
</block>

<block name="heading">添加新闻</block>

<block name="content">
    <form class="form-horizontal" method="post" action="/admin/news/save" enctype="multipart/form-data">
        <div class="form-group mb-md">
            <label for="new_categories_id" class="col-xs-4 control-label">所属栏目</label>
            <div class="col-xs-8">
                    <select class="form-control" id="new_categories_id" name="new_categories_id" required>
                        <foreach name="datas" item="item">
                            <option value="{$item.id}" >{$item.title}</option>
                        </foreach>
                    </select>
            </div>
        </div>
        <div class="form-group mb-md">
            <label for="title" class="col-xs-4 control-label">新闻标题</label>
            <div class="col-xs-8">
                <input type="text" class="form-control" id="title" name="title" required>
            </div>
        </div>

        <div class="form-group mb-md">
            <label for="image" class="col-xs-4 control-label">新闻图片</label>
            <div class="col-xs-8">
                <input type="file" class="form-control" id="image" name="image" required>
            </div>
        </div>

        <div class="form-group mb-md">
            <label for="contents" class="col-xs-4 control-label">新闻描述</label>
            <div class="col-xs-8">
                <textarea class="form-control" id="contents" name="content" required></textarea>
            </div>
        </div>

        <div class="form-group mb-md">
            <label for="content" class="col-xs-4 control-label">新闻详情</label>
            <div class="col-xs-8">
                <textarea class="form-control" id="content" name="news_content" required></textarea>
            </div>
        </div>



        <div class="form-group mb-md col-xs-9 pull-right">
            <button class="btn btn-block btn-success" type="submit">提交</button>
        </div>
    </form>
</block>

<block name="js">
    <script type="text/javascript" src="__PUBLIC__/assets/demo/demo.js"></script>
    <script type="text/javascript" src="__PUBLIC__/assets/demo/demo-switcher.js"></script>
    <script type="text/javascript" src="__PUBLIC__/assets/plugins/bootbox/bootbox.js"></script>

    <script type="text/javascript"
            src="__PUBLIC__/assets/plugins/form-pagedown/js/jquery.pagedown-bootstrap.combined.js">
    </script>
    <script>
        $(document).ready(function () {
            $("textarea#content").pagedownBootstrap();
            $('.wmd-preview').addClass('well');
        });
    </script>
</block>


